//
// Created by Zhangwj on 2023/9/25.
//

#ifndef COMPILE_TASK2_COMPUNITNODE_H
#define COMPILE_TASK2_COMPUNITNODE_H


#include <memory>
#include <vector>
#include "SyntaxTreeNode.h"
#include "DeclNode.h"
#include "FuncDefNode.h"
#include "MainFuncDefNode.h"
#include "../Parser.h"

class CompUnitNode : public SyntaxTreeNode {
public:
    //CompUnit → {Decl} {FuncDef} MainFuncDef
    std::vector<std::unique_ptr<DeclNode>> Decls;
    std::vector<std::unique_ptr<FuncDefNode>> FuncDefs;
    std::unique_ptr<MainFuncDefNode> MainFuncDef;

    static std::unique_ptr<CompUnitNode> CompUnitParser(Parser &parser);
};


#endif //COMPILE_TASK2_COMPUNITNODE_H
